package com.efounder.holder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.efounder.bean.OrderDetail;
import com.efounder.mobilemall.R;
import com.efounder.utils.MyMathUtil;

/**
 * Created by Marcello on 2018/9/28.
 */
public class OrderDetailHolder extends BaseHolder<OrderDetail.OrderBean.OrderSaleInfoListBean>{

    private  TextView tv_order_pre_name,tv_order_pre_total,tv_dk_amount;

    public OrderDetailHolder(ViewGroup parent, int resId) {
        super(parent, resId);
        tv_order_pre_name = getView(R.id.tv_order_pre_name);
        tv_order_pre_total = getView(R.id.tv_order_pre_total);
        tv_dk_amount = getView(R.id.tv_dk_amount);
    }

    @Override
    public void setData(OrderDetail.OrderBean.OrderSaleInfoListBean data) {
        String string = getContext().getResources().getString(R.string.oreder_preferent_di);
        tv_order_pre_name.setText(data.getDkTypeName());
        tv_order_pre_total.setText("-"+ MyMathUtil.round3(Double.valueOf(data.getDkValue()),2));
        tv_dk_amount.setText(string+MyMathUtil.round3(Double.valueOf(data.getDkAmount()),2));

    }

}
